package com.mindao.app.hongyu.controller;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.mindao.app.common.spring.controller.BaseBaseController;
import com.mindao.app.lgc.model.Student;

/**
/* 版权所有： 广州敏道科技有限公司
/*
/* 功能描述：
/*
/* 创 建 人：李国才
/* 创建时间：2016年7月12日 下午1:54:18 	
 **/
@Controller
@RequestMapping("/hongyu/fileio")
public class FileIOController  extends BaseBaseController{

		
		@RequestMapping(method=RequestMethod.GET)
		public String fileIO(HttpServletRequest request, HttpServletResponse response, HttpSession session, Model rhs){
			rhs.addAttribute("key", "admin");
			String rtns= super.rtnDefault(request, response, session, rhs);
		   return rtns;
		}
		@RequestMapping(method=RequestMethod.GET)
		public String getnumber(HttpServletRequest request, HttpServletResponse response, HttpSession session, Model rhs){
			rhs.addAttribute("key", "12345678");
			String rtns= super.rtnDefault(request, response, session, rhs);
			
			File dir=new File("d:/");
			ArrayList dirList=new ArrayList();
			String[] filenamesStrings=dir.list();
			for (String string:filenamesStrings) {
				System.out.println(dir+"\\"+string);
				dirList.add(dir+"\\"+string);
				
			}
			rhs.addAttribute("dirList",dirList);	
						
			
		   return rtns;
		}
	}


